function CurrentTime()
{
 var str;//创建时间对象
 var time=new Date();
 var year=time.getYear();
 var month=time.getMonth()+1;
 var days=time.getDate();
 var hour=time.getHours();
 var minute=time.getMinutes();
 var second=time.getSeconds();
 var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
 var day=time.getDay();
 str="2016年"+month+"月"+days+"日"+"<br />  "+hour+":"+minute+":"+second+"  "+weekday[day];
 
 document.getElementById("txt").innerHTML=str;
}
function Init()
{
 setInterval("CurrentTime()",1000);
}